<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>编辑管理员信息</title>
		<style type="text/css">
</style>
		<script type="text/javascript" language="javascript">
function selectNoneOptions(objTargetElement) {
    for (var i = 0; i < objTargetElement.length; i++) {
        if (objTargetElement.options[i].value != '') {
            objTargetElement.options[i].selected = false;    
        }    
    }
    return false;
}

function selectAll(element) {
	var obj = document.getElementById(element);
	for (var i = 0; i < obj.length; i++) {
		if (obj.options[i].value != "") {
			obj.options[i].selected = true;
		}
	}
}

function form_submit(){
	document.getElementById("update").submit();
}
</script>
		<s:head />
	</head>
	<body>
		<form action="admin_update.action" id="update" method="post">
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td height="20" bgcolor="#FFFFFF">
						<table class="selectstyle">
							<s:optiontransferselect doubleList="areaNames" list="areas"
								doubleName="areaId" listKey="id" listValue="name"
								doubleListKey="id" doubleListValue="name" leftTitle="所有区域"
								rightTitle="所选区域" multiple="true" allowAddToRight="true"
								allowAddAllToRight="true" doubleSize="15" size="15" id="option1"
								selectAllOnclick="selectNoneOptions(document.getElementById('option1'));"
								doubleId="areaId"></s:optiontransferselect>
						</table>
					</td>
					<td height="20" bgcolor="#FFFFFF">
						<table class="selectstyle">
							<s:optiontransferselect doubleList="departNames"
								list="departments" doubleName="departmentId" listKey="id"
								listValue="name" doubleListKey="id" doubleListValue="name"
								leftTitle="所有部门" rightTitle="所选部门" multiple="true"
								doubleMultiple="true" doubleSize="15" size="15" id="option2"
								selectAllOnclick="selectNoneOptions(document.getElementById('option2'));"
								doubleId="departmentId"></s:optiontransferselect>
						</table>
					</td>
					<td height="20" bgcolor="#FFFFFF">
						<table class="selectstyle">
							<s:optiontransferselect doubleList="funcNames" list="functions"
								doubleName="funcId" listKey="id" listValue="name"
								doubleListKey="id" doubleListValue="name" leftTitle="所有权限"
								rightTitle="所选权限" multiple="true" doubleMultiple="true"
								selectAllOnclick="selectNoneOptions(document.getElementById('option3'));"
								doubleSize="15" size="15" id="option3" doubleId="funcId"></s:optiontransferselect>
						</table>
					</td>
				</tr>
				<tr>
					<td height="20" bgcolor="#FFFFFF" class="STYLE19">
						<div align="center">
							姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：
							<input type="text" name="name" value="${admin.name}">
						</div>
					</td>
					<td height="20" bgcolor="#FFFFFF" class="STYLE19">
						<div align="center">
							用户角色：
							<input type="text" name="role" value="${admin.role}">
						</div>
					</td>
					<td height="20" bgcolor="#FFFFFF" class="STYLE19">
						<div align="center">
							用户名：
							<input type="text" name="username" value="${admin.username}">
						</div>
					</td>
				</tr>
				<tr>
					<td height="20" bgcolor="#FFFFFF" class="STYLE19">
						<div align="center">
							联系方式：
							<input type="text" name="tel" value="${admin.tel}">
						</div>
					</td>
					<td height="20" bgcolor="#FFFFFF" class="STYLE19">
						<div align="center">
							<input type="button" value="确定"
								onclick="selectAll('areaId');selectAll('departmentId');selectAll('funcId');form_submit();">
						</div>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
